package com.smart.mobile.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONArray;

import com.smart.model.mobile.MarketInfo;
import com.smart.util.DBUtil;

public class MarketInfoDAO {
	/*
	 * 获取商家信息
	 * */
	public List<MarketInfo> getMarketInfo() throws SQLException{
		List<MarketInfo> list = new ArrayList<MarketInfo>();
		String sql = "select * from market";
		Connection conn=DBUtil.getConnection();
	    PreparedStatement pSt = conn.prepareCall(sql);
	    ResultSet rs=pSt.executeQuery();
	    MarketInfo marketinfo;
	    while(rs.next()){
	    	marketinfo = new MarketInfo();
	    	marketinfo.setID(rs.getInt("ID"));
	    	marketinfo.setmarketname(rs.getString("marketname"));
	    	marketinfo.setmarketyouhui(rs.getString("marketyouhui"));
	    	marketinfo.setmarketimg(rs.getString("marketimg"));
	    	marketinfo.setMarketmini(rs.getString("marketminiimg"));
	    	list.add(marketinfo);
	    }
		return list;
	}
}
